/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package server;

import java.util.LinkedHashMap;
import java.util.Map;

import java.util.Map.Entry;


public class MapleAchievements {

    private Map<Integer, MapleAchievement> achievements = new LinkedHashMap<Integer, MapleAchievement>();
    private static MapleAchievements instance = new MapleAchievements();

    protected MapleAchievements() {
        achievements.put(1, new MapleAchievement("conseguir o primeiro ponto", 1000, false));
        achievements.put(2, new MapleAchievement("alcancar level 30", 1000, false));
        achievements.put(3, new MapleAchievement("alcancar level 70", 3000, false));
        achievements.put(4, new MapleAchievement("alcancar Level 120", 8000, false));
        achievements.put(5, new MapleAchievement("alcancar level 200", 15000, false));
        achievements.put(7, new MapleAchievement("alcancar 50 de fame", 5000, false));
        achievements.put(9, new MapleAchievement("equipar um item reverse", 4000, false));
        achievements.put(10, new MapleAchievement("equipar um item timelessequipped a timeless item", 5000, false));
        achievements.put(11, new MapleAchievement("por falar our server rocks", 1000, false));
        achievements.put(12, new MapleAchievement("matar Anego", 3500, false));
        achievements.put(13, new MapleAchievement("matar Papulatus", 2500, false));
        achievements.put(14, new MapleAchievement("matar um Pianus", 2500, false));
        achievements.put(15, new MapleAchievement("matar o grande Zakum", 5000, false));
        achievements.put(16, new MapleAchievement("derrotar o Horntail", 15000, false));
        achievements.put(17, new MapleAchievement("derrotar o Pink Bean", 30000, false));
        achievements.put(18, new MapleAchievement("matar um boss", 1000, false));
        achievements.put(19, new MapleAchievement("ganhar o evento 'OX Quiz'", 5000, false));
        achievements.put(20, new MapleAchievement("ganhar o evento 'MapleFitness'", 5000, false));
        achievements.put(21, new MapleAchievement("ganhar o evento 'Ola Ola'", 5000, false));
        achievements.put(22, new MapleAchievement("derrotar a BossQuest no modo HELL", 50000));
        achievements.put(23, new MapleAchievement("matar o poderoso Chaos Zakum", 10000, false));
        achievements.put(24, new MapleAchievement("derrotar o Chaos Horntail", 20000, false));
        achievements.put(25, new MapleAchievement("ganhar o evento 'Survival Challenge'", 5000, false));
        achievements.put(26, new MapleAchievement("hitar acima de 10000", 2000, false));
        achievements.put(27, new MapleAchievement("hitar acima de 50000", 3000, false));
        achievements.put(28, new MapleAchievement("hitar acima de 100000", 4000, false));
        achievements.put(29, new MapleAchievement("hitar acima de 500000", 5000, false));
        achievements.put(30, new MapleAchievement("hitar 999999 de dano", 10000, false));
        achievements.put(31, new MapleAchievement("conseguir mais de 1 000 000 mesos", 1000, false));
        achievements.put(32, new MapleAchievement("conseguir mais de 10 000 000 mesos", 2000, false));
        achievements.put(33, new MapleAchievement("conseguir mais de 100 000 000 mesos", 3000, false));
        achievements.put(34, new MapleAchievement("conseguir mais de 1 000 000 000 mesos", 4000, false));
        achievements.put(35, new MapleAchievement("criar uma guild", 2500, false));
        achievements.put(36, new MapleAchievement("criar uma familia", 2500, false));
        achievements.put(37, new MapleAchievement("terminar com sucesso a Crimsonwood Party Quest", 4000, false));
        achievements.put(38, new MapleAchievement("derrotar Von Leon", 25000, false));
        achievements.put(39, new MapleAchievement("derrotar Empress Cygnus", 100000, false));
        achievements.put(40, new MapleAchievement("equipar um item acima do level 130", 10000, false));
        achievements.put(41, new MapleAchievement("equipar um item acima do level 140", 15000, false));
    }

    public static MapleAchievements getInstance() {
        return instance;
    }

    public MapleAchievement getById(int id) {
        return achievements.get(id);
    }

    public Integer getByMapleAchievement(MapleAchievement ma) {
        for (Entry<Integer, MapleAchievement> achievement : this.achievements.entrySet()) {
            if (achievement.getValue() == ma) {
                return achievement.getKey();
            }
        }
        return null;
    }
}
